<?php if(!empty($list)): ?>
<?php foreach($list as $item): ?>
    <?php $count = 0; ?>
    <li>
        <div class="scy-merch am-cf">
            <div class="merch-left">
                <i class="check-wrapper"></i> <?php echo $item['alias_name'];?>
            </div>
            <div class="merch-right">
                <?php if($item['order_state'] == 1 && $item['order_status'] == 1): ?>
                    交易取消
                <?php elseif($item['order_state'] == 1 && $item['order_status'] == 2): ?>
                    等待买家付款
                <?php elseif($item['order_state'] == 2 && $item['order_status'] == 3): ?>
                    等待卖家发货
                <?php elseif($item['order_state'] == 2 && $item['order_status'] == 4): ?>
                    卖家已发货
                <?php elseif($item['order_state'] == 3 && $item['order_status'] >= 5): ?>
                    交易成功
                <?php endif ?>
            </div>
        </div>

        <div class="merch-product">
            <a href="<?php echo site_url('tourism/user/orderDetail/'.$item['order_id'])?>">
                <?php foreach($item['shop_goods'] as $value): ?>
                    <?php $count += $value->number; ?>
                    <div class="product-classify am-cf">
                        <div class="classifyImg">
                            <img src="<?php echo $this->config->show_image_url($value->goods_image, '300-300'); ?>">
                        </div>
                        <div class="classifyText">
                            <p><?php echo $value->goods_name;?></p>
                            <?php if(!empty($value->attribute_value)): ?>
                                <div class="fyText">
                                    <?php $attribute =explode(',',$value->attribute_value)?>
                                    <?php foreach($attribute as $val): ?>
                                        <span><?php echo $val ?></span>
                                    <?php endforeach ?>
                                </div>
                            <?php endif ?>
                        </div>
                        <div class="price-o-Text">
                            <p class="price-jg">¥<?php echo $value->pay_amount;?></p>
                            <p>X<?php echo $value->number;?></p>
                        </div>
                    </div>
                <?php endforeach ?>
            </a>
        </div>
        <div class="priceText">
            共 <?php echo $count;?> 件商品 合计：<span>¥<?php echo bcadd($item['order_pay_total'], $item['transport_cost'], 2);?></span>（含运费¥<?php echo $item['transport_cost'];?>）
        </div>
        <?php if($item['order_status'] != 1 && $item['order_status'] != 3): ?>
            <div class="operaTion">
<!--                --><?php //if($item['order_state'] == 1 || $item['order_status'] == 1): ?>
                <!--                                交易取消-->
            <?php if($item['order_state'] == 1 && $item['order_status'] == 2): ?>
                <a href="<?php echo site_url('tourism/usertopay/payOrder/'.$item['order_sn']) ?>" class="clred"> 去支付</a>
                <a href="javascript:;" class="order-cancel" data-id="<?php echo $item['order_id'] ?>" > 取消订单</a>
<!--                --><?php //elseif($item['order_state'] == 2 && $item['order_status'] == 3): ?>
                <!--                                等待卖家发货-->
            <?php elseif($item['order_state'] == 2 &&  $item['order_status'] == 4): ?>
                <a href="javascript:;" class="clred order-enter" data-id="<?php echo $item['order_id'] ?>" > 确认收货</a>
            <?php elseif($item['order_state'] == 3 && $item['order_status'] == 5): ?>
                <a href="<?php echo site_url('tourism/tourismevaluate/evaluate/'.$item['order_id']) ?>" class="clred" > 评价</a>
            <?php endif ?>
            <?php if($item['order_state'] >= 2 &&  $item['order_status'] >= 4): ?>
                <a href="<?php echo site_url('tourism/user/tracking/'.$item['order_id']) ?>"> 查看物流</a>
            <?php endif ?>
        </div>
        <?php endif ?>
    </li>
<?php endforeach ?>
<?php else: ?>
<div class="no-order">
    <div class="occ-no">
        <div class="no-img">
            <img src="/skins/tourism/images/fk.png">
        </div>
        <p>您还没有相关的订单</p>
        <a href="<?php echo site_url('tourism/tourismprovider/grid');?>" class="am-btn">随便逛逛</a>
    </div>
</div>
<?php endif ?>